define next_end_id before next_block