fix kmeans bug