fix global scope and requirejs deps