Say a little prayer that the makers of "My Best Friend's Wedding" changed the ending of the movie at the last minute.

Director P.J. Hogan revealed to Entertainment Weekly that the classic 1997 romantic comedy had a completely different ending — that nobody liked.

The final version ends with Julianne (Julia Roberts) giving up on her quest to ruin the wedding of best friend Michael (Dermot Mulroney) and bride Kimmy (Cameron Diaz). At the reception, she is surprised when gay pal George (Rupert Everett) shows up to dance with her.

Originally, Hogan said that Julianne meets a new man in the final scene, played by John Corbett. But test audiences hate it. "They wanted her dead," he admitted, for her vicious actions toward Kimmy earlier in the movie.

To make Julianne more empathetic to the audience — while still giving the studio a happy ending for Roberts — Hogan and team expanded the character of George.

"Every time Julianne talked to him, she'd explain why she was doing these terrible things," he noted. "He's her conscience throughout."

They ended up shooting a new ending eight months after production wrapped. Roberts had to wear a wig over a new pixie cut.

"It would have been such a downer of an ending if George hadn't shown up," Hogan said. "That one scene somehow gave the audience permission to forgive Julianne. Those last five minutes really made the whole movie work."

Want more stuff like this? Like us on Facebook.