programming of 4wd robot using ping sensor

I made the modifications and it works fine when I put just one condition, when I put a second condition the sensor stops reading.