Fix for onstatechange function passed into the slider directly