add slider.destroying
corrected if statement