Game won't unpause after pausing

Pressing ‘escape’ key pauses the game without no issue. But it can’t be unpaused again. Neither the button in the panel nor pressing the ‘escape’ key again work… Game simply can’t be unpaused once it is paused. Following is the code… Any help is much appreciated. Thanks.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.Characters.FirstPerson;

public class PauseGame : MonoBehaviour {

	public bool paused = false;
    public GameObject thePlayer;
    public GameObject pausedMenu;

	void FixedUpdate () {
		if (Input.GetButtonDown("Cancel")) {
            if (paused == false) {
                Time.timeScale = 0;
                paused = true;
                pausedMenu.SetActive(true);
                thePlayer.GetComponent<FirstPersonController>().enabled = false;
                Cursor.visible = true;
            }
            else {
                thePlayer.GetComponent<FirstPersonController>().enabled = true;
                paused = false;
                pausedMenu.SetActive(false);
                Time.timeScale = 1;
            }
        }
	}
	
	public void UnPauseGame() {
		thePlayer.GetComponent<FirstPersonController>().enabled = true;
		paused = false;
		pausedMenu.SetActive(false);
		Time.timeScale = 1;		
	}
}

@imran-arif011 Thanks… Just using 'Update" function instead of “FixedUpdate” fixed the issue. The code I posted in the question works perfectly fine. I tried your code too. It doesn’t work properly. Kinda gives unpredictable pauses when ‘escape’ pressed. Anyway, thanks for the answer. Appreciate it.