fix checkBalance not updating and added comments