Fixed a bug in updating the account balance when creating a transaction