js template not work fully