fixed clustering bug