rewrite js 1.2