updated template and demo.js