refactored and added prompt if user selects to cancel at changing