add the dialog when click back button