fixes #5761 in master 3.0