fixes #5709 in master 3.0