Fix for race condition.