port 1.5 (cherry picked from commit 95e1d6b72e)
95e1d6b72e
(cherry picked from commit 3c5245914f)
3c5245914f