Downgrade of FPS while using SelectionGrid

Hello, how could i fix my PFS downgrade problem ? When I am running the game FPS are stable around 66-70, but as soon as i hit my first selection grid FPS are going down to 20.

Here is a piece of code with my grid.

private var selGridInt	: int = 0;
var selStrings : String[] = ["Skill 1", "Skill 2", "Skill 3"];
var showSelectionGrid : boolean = false;

function Start () {
            selGridInt = selGridInt-1;
}

function ... () {
if (GUILayout.Button("Skills")) {
    	showSelectionGrid = !showSelectionGrid;   
    }   
}

function ShowSelectionGrid () {
	
	if (showSelectionGrid == true) {
	selGridInt = GUI.SelectionGrid (Rect (125, 125, 100, 150), selGridInt, selStrings, 1);
	}	
	
	if (selGridInt == 0) {
		Debug.Log("Selection grid = " + 0);	
	}

function OnGUI () {
     ShowSelectionGrid();
     ....(); 
}

My guess is that the first clicked grid is somehow interfering with already opened GUI.

Ok i think i have fixed the problem. I have never used GUI.changed which seems to be the problem with FPS. Now it’s all working just fine.

function ShowSelectionGrid () {
	
	if (showSelectionGrid == true) {
		selGridInt = GUI.SelectionGrid (Rect (125, 125, 100, 150), selGridInt, selStrings, 1);
	}	

	if (GUI.changed) {
		Debug.Log("Selection grid was clicked");
		
		if (selGridInt == 0) {
			Debug.Log("Selection grid = " + 0 + " was clicked");
		}else {
			Debug.Log("Selection grid = " + 1 + " was clicked");
		}
	
	}