fix knn problem