add code to query paged data.