sync from At.js. some function upgraded