Change totalPages behaviour