fixing broken pipe issue #1