fix nth-match bug