Fixed race condition bug.