lock map, when asynchronous goroutines write to it later