working but template.js is wrong