Resubmit for 5.0.x
Prevent from getting broken pipe item
fixed patch errors