fixing bug with slider not working