added pagination for listing posts