Fixes a slider issue going out of range

Fixed a range issue and prevented setting the value outside the range