Make map writes thread safe