Fix undef value when clicking end of slider