fix edit_dist bug