fixes centroid error in set region calc