Improve idea for corrupted stream handling