fixed define lexical scoping bug