update scoping for renaming vars