reimplemented updateSlider as a prototype function