Fix condition when closing