fix multiple match bug