data race fixes