Added pagination for history