backport for #2887

good catch. I had to do cherry-pick for my second commit as well. 

I will fix it now.