added function prior to loading js to allow dom to load before script