Fixing leaky dishwasher

I found a leak in my dishwasher. The attached picture shows the electrical connector that goes to the heating element has unattached from the dishwasher. You can also see a crack in the nut. I was wondering if I can take some sealant and reattach this too the dishwasher or if I need to replace the whole assembly. Thanks