bug fix for balancing