fixing cleanup in rebalancing