Move this check into the `if (pageNumber)` block below.