fix data race