Fixed broken pipe issue on client side