Update template.js

Fix #10