Fixed a bug where the totals were not being auto calculated