handle paging of results