refactored to load js on each new page