flush correct output stream at end of marking