Fixes bug with overlay being hidden but visible