made the num of partition for each domain is dynamic