Can't get slider to work correctly