fixed syntax problem in cg.js