always replace whole output in 1st and 2nd iteration, even if it is the last