fix uninitialized stream error