MZ Script for menu option

Hi guys, I have a problem with a script I'm working on. Basically, I want to create a new option in the menu, I managed to do that, but when I click on the option it opens but does not close.

// Define the Scene_MyMenuOption class
function Scene_MyMenuOption() {
this.initialize.apply(this, arguments);
}
Scene_MyMenuOption.prototype = Object.create(Scene_MenuBase.prototype);
Scene_MyMenuOption.prototype.constructor = Scene_MyMenuOption;
Scene_MyMenuOption.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_MyMenuOption.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createMyMenuOptionWindow();
};
Scene_MyMenuOption.prototype.createMyMenuOptionWindow = function() {
var x = 0;
var y = 0;
var width = Graphics.boxWidth;
var height = Graphics.boxHeight;
this._myMenuOptionWindow = new Window_Selectable(new Rectangle(x, y, width, height));
this._myMenuOptionWindow.setHandler('cancel', this.popScene.bind(this));
this.addWindow(this._myMenuOptionWindow);
};
// Add the menu command to the main menu
var _Scene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function() {
_Scene_Menu_createCommandWindow.call(this);
this._commandWindow.setHandler('myMenuOption', this.commandMyMenuOption.bind(this));
};
Scene_Menu.prototype.commandMyMenuOption = function() {
SceneManager.push(Scene_MyMenuOption);
};
var _Window_MenuCommand_makeCommandList = Window_MenuCommand.prototype.makeCommandList;
Window_MenuCommand.prototype.makeCommandList = function() {
_Window_MenuCommand_makeCommandList.call(this);
this.addCommand('Status', 'myMenuOption');
};
Moved to: Javascript/Plugin Support

Original thread: https://forums.rpgmakerweb.com/threads/script-for-menu-option.155550/