shouldn't this be in the `if (doOutput)` clause?