Added isClosed method