templates and js fixed