terminate string initially for valid output given no nodes