fixed requirejs refactoring bugs