update batching code