backport #5432