more optimization on slider.js