Kenmore washer

The code on the washer is FDL. I replaced the door latch. I cleaned out the trap and removed socks and a pencil. After doing this it still comes up with the same code. Sometimes it will start and most of the time it doesn"t. Also it is leaving water in the tub, and won’t start again. If you try to reset sometimes it will start again and other times it doesn’t. This is the second door switch assembly that I have put on it. The first one worked for about 4 months. Can you help me with this? Nozzel76