added pagination for posts