Fixed issue with exiting from popup via the x btn