added functionality to back button