added exit functionality to the main menu