fix pagination for posts