Fixed jquery problem with template.