@@ -370,6 +370,7 @@ def buildhtmlheader(self):
         """generate HTML header content"""
         self.htmlheader = ''
         # If the JavaScript assets have already been injected, don't bother re-sourcing them.
+        global _js_initialized
         if not _js_initialized:
             for css in self.header_css:
                 self.htmlheader += css