fix a bug in ShadowStream.end()