Fix runtime error with slider