broken pipe bug fix