now multithreading in batchSplitAndLoop