Fix updateTotal method