Add pagination for history