Refactored isPopupOpen method
v5.0.2