reopen stream on close