Add the auto id at the right place in env to have it available for output