fix a data race