Race condition fix.