pagination with some endless scrolling code