fixing slider behaviour