pagination on devices replaced with a loop