max_id check