Moved JS call to header from footer