Added better error handling for failed streams