Fix the situation where there is more than one of the color of a match by position in the code