Washer wont stop fillng

Washer has over filled 3 times in the last month, the rest of the tmie it works fine.

sounds like a bad water level switch