added functionality to prompt the user to save on quit