TORONTO (AP) — A flight heading from Toronto to New York City earlier this month had to turn around because of a “burnt electrical smell” in the cockpit.

The Transportation Safety Board of Canada said Endeavor Air Flight 4826 left Toronto’s Pearson International Airport the morning of Feb. 3 and was headed to JFK airport in New York when the flight crew declared an emergency.

The safety board said the crew was investigating the smell on the Bombardier twin-engine jet when the captain’s-side windshield electrical heater control unit began emitting sparks and flames.