use the streams properly