fixes #5846 in master 3.0