Backport 6138 stable6

Backport #6138 stable6