export registry first
error message improved