Added confirmation on cancel

Added confirmation if the user has changed anything and tries to cancel.