Changed check for ScopeWrapper