messed up the isOpen variable