process errors in batches