call next_end_id