Fix issue with javascript not loading on pages other than the main