update for new nesting of scopes