Updated use of stream for the new SDK which fixes a related bug