add a method to check is session is closed