fixes #5799 in master 3.0