Added pagination for history page