When the main menu closes the whole application shuts down