Slider jumping to 100% position

Slider jumping to 100% position

I have a slider, min=0, max=325, starts with a value of 0 so all pretty standard.

I am using a timer to update the slider value once a second with a value I get from the back end server. The value is simply increasing so 1,2,3 etc so the slider moves along as the value increases.
This all works fine until I set the value to 4 and then the slider jumps to the end. Inspecting the div shows a style of width: 100%.

When I added some code to display the min,max and current values from the slider after each refresh I see that after setting the value to 4, the value returned from the slider is 325 (same as max) which accounts for the 100% positioning.

When the value I am setting in the control gets to 100, it resets itself to the correct value again and the slider reverts to the correct position but until then the control is returning 325 for the value.

This is not specific to the 325 max value, it happens for all my other values as well. The only time I did NOT have this problem was when I had max set to 100 (because I was moving the slider based on the number as a percentage so the biggest number I ever got from the back end was 100), since I've switch to using absolute numbers (these are play times of songs in seconds) it has started behaving weird.

Any ideas? Something I did or a bug?
I looked at the slider js from github but I am no js expert (not even close) so I am none the wiser (yet, I will keep looking).

Thanks for any info