fix some bugs on require js