use scopechain instead of vars object