added isOpen bool