fix #2 Changing the total value dynamically