add match end condition.