I had a repairman diagnose it as a main panel. I replaced it but same problem. I pulled out the element assembly and found the thermal fuse was bad. I replaced the thermal fuse and it worked one cycle and blew again. Next time I replaced the thermostat as well as the thermal fuse. That resolved the issue. The thermostat was bad causing the thermal fuse to blow.