sync with upstream 54a6b9df