Add back button exit function