Add match end logic.