fixed bug in checkBalance method