fixes #5846 in master 2.5