added fix for duplicate datasets

i.e. last item on page 4 is first on page 5