paginate correctly, instead of duplicating results