Mine was sparking because of a piece of food on the electo-magnet.
After cleaning my toaster outside with my hose-end sprayer with soap in the dispenser (Miracle-Gro hose-end sprayer) then letting it dry for a few days, I plugged it in and pushed it down and it Sparks inside... I took it apart and found a piece of food product had burned into the electromagnet. I cleaned it off with a fingernail emory board. Then I put it back together and it works great!!!
I'm sure a dishwasher works just as well.
Also, I heated my oven to 150°, then shut the oven off and put the toaster in for about an hour to be sure it was dry. Don't let the cord touch anything hot.