change to parse a stream