fix bug in match generator