add logic to update client side total