add output visitor logic