save template error javascript syntax