pause menu not working right

heres my code for a pause menu i’m trying to set up and it doesn’t seem to be working right any help would be great i all so get this warning GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced (type:5)
UnityEngine.GUIUtility:EndGUI(Int32, Int32, IDList)

heres the code for you to look at

var isPaused : boolean = false;




function Update()
{

     if(Input.GetKeyDown("escape")  !isPaused)
   {
      print("Paused");
      Time.timeScale = 0.0;
      isPaused = true;
   }
   else if(Input.GetKeyDown("escape")  isPaused)
   {
      print("Unpaused");
      Time.timeScale = 1.0;
      isPaused = false;    
   } 
}

function OnGUI (){

       if(isPaused)
    {
     GUI.BeginGroup (Rect (Screen.width / 2 - 50, Screen.height / 2 - 50, 100, 100));
      // RenderSettings.fogDensity = 1;
     
       if(GUI.Button (Rect((Screen.width)/2,480,140,70), "Quit"))
      {
         print("Quit!");
         Application.LoadLevel("menu");
      }
      if(GUI.Button (Rect((Screen.width)/2,560,140,70), "Restart"))
      {
         print("Restart");
         Application.LoadLevel("scene_1");
         Time.timeScale = 1.0;
         isPaused = false;
      }
      if(GUI.Button (Rect((Screen.width)/2,640,140,70), "Continue"))
      {
         print("Continue");
         Time.timeScale = 1.0;
         isPaused = false;
       
           GUI.EndGroup ();   
      }
   } 


}

never mind fixed it and heres my working code for poeple who want to use it

var isPaused : boolean = false;




function Update()
{

     if(Input.GetKeyDown("escape")  !isPaused)
   {
      print("Paused");
      Time.timeScale = 0.0;
      isPaused = true;
   }
   else if(Input.GetKeyDown("escape")  isPaused)
   {
      print("Unpaused");
      Time.timeScale = 1.0;
      isPaused = false;    
   } 
}

function OnGUI (){

       if(isPaused)
    {
     GUI.BeginGroup (Rect (Screen.width / 2 - 50, Screen.height / 2 - 50, 100, 300));
      // RenderSettings.fogDensity = 1;
     GUI.Box (Rect (0,0,100,200), "Paused");
     
        if (GUI.Button (Rect(10,40,80,30), "Quit")){
		
		Application.LoadLevel("menu");
      }
     if  (GUI.Button (Rect(10,80,80,30), "Restart")){
         
   		 Application.LoadLevel("scene_1");
         Time.timeScale = 1.0;
         isPaused = false;
      }
      if (GUI.Button (Rect(10,120,80,30), "Continue")){
        
         Time.timeScale = 1.0;
         isPaused = false;
       
           GUI.EndGroup ();   
      }
   } 

}

I think you should move the ‘GUI.EndGroup()’ one line down, below the next ‘}’.
As it is now, it will only close the group if the ‘Continue’ button is pressed.
The compiler may not complain, as you have an even balance of ‘BeginGroup’ and ‘EndGroup’ pairs.