IllegalStateException on exiting to main menu fixed