adjusted Foundation loading script