Rearranged the order in which the JS is loaded for history