Why is my script not working?

using UnityEngine;
using System.Collections;

public class PauseMenu : MonoBehaviour
{

public string mainMenu;
public bool isPaused;
public GameObject pauseMenuCanvas;

// Update is called once per frame
void Update () 
{
if (isPaused) {
		pauseMenuCanvas.SetActive (true);
	} else
		pauseMenuCanvas.SetActive (false);
}

if(Input.GetKeyDown(KeyCode.Escape))
{
isPaused = !isPaused;
}

public void Resume ()
{
isPaused = false;
}

public void Exit ()
Application.LoadLevel(mainMenu);

}

There’s an extra } after the else where you set the pauseMenuCanvas to inactive (line 14 in the code in the question. Please post all errors regarding your script as it comes up in the editor and do not post such “Check My Code!” questions without proper information, Googling a solution yourself and trying your best to solve the problem.