add common function to think.js