just changed this to also guard on doOutput so that there aren't any worries about things.