fix data races