what is the reason for this check? it looks like quite a weird thing to do. when does `createConnection` return the same stream twice?