batch processing loop fix