backport to 2.6