backport lp:1392390 fix to 1.21