detect undefined scope