fix get ref from stream