removeOverlayIfVisible

Removes the overlay if visible. It can be used to force remove the overlay.