fix a session related bug