totalPages is at least 1, not 0