making a pause menu

when i press escape the menu appear on the screen, but whenever i press escape again, nothing happens.
has it something to do with the boolean, or is it that its in the same function?

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Pause : MonoBehaviour {

	public Canvas PauseCanvas;
	public Button Resume;
	public Button Settings;
	public Button ExitToMainMenu;
	public Button ExitToDesktop;
	public Canvas SettingCanvas;
	public bool isPaused;


	// Use this for initialization
	void Start () 
	{
		SettingCanvas.enabled = false;
		Cursor.lockState = CursorLockMode.Locked;
		Cursor.visible = false;
		isPaused = false;
		PauseCanvas.enabled = false;
	}
	
	// Update is called once per frame
	void Update () 
	{
		if(Input.GetKeyDown(KeyCode.Escape) && !isPaused)
		{
			PauseCanvas.enabled = true;
			isPaused = true;
		}

		if(Input.GetKeyDown(KeyCode.Escape) && isPaused)
		{
			PauseCanvas.enabled = false;
		}
	}

Try this :

void Update ()
	{
		if (Input.GetKeyDown (KeyCode.Escape)) {
			if (!isPaused) {
				
				PauseCanvas.enabled = true;
				isPaused = true;
				return;
			}
			PauseCanvas.enabled = false;
			isPaused = false;
		}
	}