fix Levenshtein distance bug