bettwer handling of end-of-session