declaring slider only once