Fixed click handler for closing overlays