fixed global scope handling by AMD modules