bug fix in balanced