add edit distance in constraint