threading fixes
threading fixes