fixed k-means bug