patching upstream to 3.0.17