update template and javascript