Replace isOpen state with DOM check