Fixing threadID bug