introduce the isClosed method to session