correcting from stream API