modified environment of generated function