fix bug 2432 for 2.4 branch
Merge pull request #3500 from StevenPuttemans:fix_2432_2.4