before change to stream