frigidaire washer door will not lock

My front loader washer door will not lock properly. It will lock occasionally but not everytime, so I replaced the door lock assembly thinking it was going bad. I have installed the new part but it still is not locking properly. Any suggestions?

We had a couple of power outages and as a result… The panel electronic panel does not work not does the water or ice maker. Also, it does not appear the fridg is not cooling properly. We tried unplugging to reset and that did not work either. Any ideas are greatly appreciated…