fixed processes KeyError due to more threads than batches