added fix for broken pipe issues