fix utf compare, off by 1 and break out of loop on hit