Add shutdown to kmeans