Fixed bug where the incorrect credit balance was updated