make isOpen to 0 to test