fix error in slider when @slider is nill