knn concurrency fixes