fix session terminating