added logic for sliders