HC-SR04 Ultrasonic Sensor Dies After 1.5 Min [SOLVED]

Why are continuously setting the pin modes in the loop? Once should be enough and in the setup function.

Paul