fix regression from PERL-465 cherry pick