Added isOpen function.