merging batches