Much better fix for concurrency problem.