fix process_batch