fixed #2120 following Clement Mouchets suggestion
fixed #2120