Add error checking for streaming