fixed bug in getbalance()