making session closeable