apply patch from bug 850396
merged