better fix for the regression (see previous commit)