Added a controller function for the back button