working back button and app exiting