fixes adding javascript to the templates