js template bug fixed