add tests for max_id