Fixing js to show updated total