add totalPages computed containing the total number of pages