fixed bug with best match