change numItemsPerPage to itemsPerPage