add function that auto samping while running rebalancing.