don't close the stream before we're done with it, duh