bug fix for AMD, checked `window` element instead `require`.