Add functionality to back button