adding flushing to output