Fix pagination with dynamic set retrieval