modified rebalancing bug