fixed bug where process output would not be written to console until stream is flushed