sess init, for gracefully exit
gracefully exit, store session