Implemented closed and locked flag handlers