sync with upstream af29425b1e17