javascript template fix