fix knn bug