get rid of the invalid match