fix to pagination when the first and the last element has class ls-active