fix the match replacement