added back button functionality for closing overlays