fill cycle shuts off before full

hello my washer started not filling properly. whenj it starts to fill it stops before it hits proper level the i have to push the knob back in the pull it out to get it to start filling again. but after i get it to fill it works properly and finishes the load.