fixed issue 1294, thanks Vincent Chevrier