Fix threading issue.