merged from upstream because rebase was broken