#317 applying rlouapre's change to the dev branch