Washer will not fill completely

When starting the wash cycle the water will not fill completely to start the aggitation cycle. it starts draining before completing. I swithced the water level switch and it worked once after that, but did it again on the next load.

It can be the control unit, but first try checking and reseating the wiring between the water level switch and the timer.