pagination update onscroll
refactor for pagination