fix the bug for session.