sync with upstream 4a9e567