Fixed a logic in the menu exit