replaced ugly data race