cherry-pick john's change