Fixing threading for Ted