fix the session None attr error