Add a flush to make sure output is flushed to screen after a print.