sync with upstream 1d9e336