Tonight's Oscars ceremony won't be forgotten anytime soon. As always, there were many memorable moments, but the most memorable of all was when Jordan Horowitz, producer of La La Land, announced to the audience that--contrary to what they'd just heard from Faye Dunaway--his movie had not won the Academy Award for Best Picture. Moonlight had instead. It was, as The New York Times noted, kind of like a Hollywood ending.

How did this debacle happen? We don't yet know the details, but here are some obviously bad mistakes that all of us can learn from:

1. Someone handed Warren Beatty the wrong envelope.

The card in the envelope read "Best Actress: Emma Stone, La La Land." Emma Stone had indeed won the Oscar for Best Actress a few minutes earlier. Stone told the Washington Post that from that moment on she had been standing backstage clutching both her Oscar and the card that said she'd won. So that card could not have made its way to Dunaway and Warren Beatty, who were announcing the Best Picture award.

But--just in case of emergencies--there are two copies of each card and envelope. Only two people, both from accounting firm PwC, handle the Oscar envelopes. Given where each of them was standing, it seems likely that it was PwC partner Brian Cullinan who accidentally handed Beatty the "Best Actress" envelope, perhaps because the lettering on the envelope was hard to read in the low light backstage. Without assigning responsibility to any individual, PwC issued a statement today apologizing for the error. (Thank you to the reader who tweeted me an article with a full explanation of how the Oscar count and cards are handled.)

2. Warren Beatty was too slow to react.

After opening the envelope, Beatty paused for several beats, staring at the card. "And the Academy Award..." he said, then paused again. "...for best picture...." Another pause.

By this time, the audience was sure that he was hamming it up and began laughing. Finally, he handed the card and envelope to Dunaway.

This kind of thing would be easy to forgive in a new star, unaccustomed to the limelight, but Warren Beatty is anything but that. He should have had the presence of mind to put a stop to the proceedings, explaining to the audience that there appeared to have been a mistake. It certainly could have saved the producers of La La Land running up onstage and giving acceptance speeches for a prize they didn't actually get.

3. Faye Dunaway jumped the gun.

"You're awful!" she told the tongue-tied Beatty, glanced at the card and announced, "La La Land." If she had paused in her rush to save the event from going off track and had taken a closer look at the card, she too would have realized that something wasn't right.

After she made the announcement, Beatty missed another chance to stop the proceedings by saying something like, "Wait a moment, there seems to be something wrong with this card--can we get confirmation please?" Instead, he just stood there and smiled.

Jordan Horowitz should win the Oscar for classiest reaction.

As the La La Land producers crowded the stage and gave their acceptance speeches, you could see people running back and forth in the background and a man with a headset talking to some of the people onstage. Horowitz had already given his acceptance speech and another La La Land producer, Fred Berger, was in the midst of giving his when he turned around for a moment, turned back, and told the audience, "We lost, by the way."

Jimmy Kimmel, the event's host, quickly joined the group onstage and began cracking jokes to lighten the mood, suggesting that they should give another Oscar to La La Land. "Why can't we just give out a whole bunch of them?" he asked. Beatty then stepped to the microphone and explained what he saw when he opened the envelope. "I wasn't trying to be funny," he added.

But Horowitz was gracious and self-possessed from the moment the error was discovered. He was the one who announced that Moonlight had actually won, and held up the card with "Moonlight" written on it so TV cameras could zoom in. He also dismissed Kimmel's commiseration, saying, "I'm going to be really proud to hand this to my friends from Moonlight."

La La Land already won six other Oscars by then, which must have softened the blow somewhat. Still, best picture is the biggest deal on Oscar night, and it must have been hard to think they'd won it, then learn they hadn't after all. Horowitz reacted with presence of mind and generosity, and he did it without missing a beat. We should all try to do as well when sudden disappointments come our way.