Fixed bug where calling main menu did not close sub menus first.