Merge pull request #18432 from deepeshgarg007/get_balance

fix: Condition fix in get_balance_on function