added pagination to allposts