Set the scope after closing the stream