Fixed race condition in refreshsession code