debugged main globs and header/template javascript