fix race detector errors