Adding some code to handle not triggering an error emit if the stream was marked to destroy