Update template.js

Update for #12