bugfix in javascript template