fixed some template render issues and create a demo.js