Added read stream error handling