run code for each version in a thread