update safe flag to w in session class