initialize output streams when actually writing data