Fixed bug that could lock mainmenu

and make it impossible to quit game