handle incomming batches