seperate thread opening out of for loop