fix session was set to null situation