example for how to use max_id with a batch