fix phrase selection issue
fix phrase matching algorithm