Fixed sync/threading issue.