moved makedirs to threadbatch