little tweak to js and added missing template