make session creation thread safe