fixes #5734 in master 3.0