fix the session bug