Resolved closed io-stream issue