add code to check size of cluster
some more error handling