added back button functionality