2nd attempt to fix pagination