Added pageSize and sortBy functionality