Titanic has become a classic for its production, performances, and its song, “My Heart Will Go On”, performed by Céline Dion. But even though the song became a worldwide hit, James Cameron wasn’t fully on board with it at the beginning – here’s what happened. Back in 1997, just three years after the release of True Lies, James Cameron returned with his biggest production at the time: Titanic, a romance and disaster film based on the accounts of the sinking of the RMS Titanic in 1912.

The film followed Rose DeWitt Bukater (Kate Winslet) and Jack Dawson (Leonardo DiCaprio), members of different social classes who fall in love aboard the ship during its ill-fated maiden voyage. Titanic was the most expensive film ever made at the time, with a production budget of $200 million, and became the highest-grossing film ever until Cameron’s Avatar (which was later surpassed by Avengers: Endgame).

Related: Titanic: The Actors Who Almost Played Jack & Rose

Titanic received multiple nominations to many awards, including 14 Academy Awards nominations, of which it won 11, among those Best Picture, Best Director, and Best Song. The latter was a huge hit, even becoming Celine Dion’s signature song, but had Cameron had it his way, the song would have never been included in the film.

Titanic: The True Story Behind “My Heart Will Go On”

Rose holds Onto Jack in the water in Titanic.

The music of Titanic is mostly orchestral, with “My Heart Will Go On” being the only song with singing in the soundtrack. It was written by Will Jennings with music by James Horner, and it was originally composed as an instrumental motif for various scenes in the film. The original plan for the soundtrack was for it to be purely instrumental, but the label had other ideas. Music supervisor Randy Gerston told Billboard that they had done a record deal with Sony to do the soundtrack, which would have been just Horner’s score, but the label had a different idea in mind, as they imagined they would get an end-title song into the film. Will Jennings was secretly brought on board to write the lyrics, and it was done like that because of Cameron’s own ideas.

The director didn’t want any songs with singing in the film, and he definitely didn’t want to end the film with a pop song. As told by Gerston, Cameron’s favorite bands were Ministry and Metallica, and the director reportedly said “would you put a song at the end of Schindler’s List?”. In the end, Cameron changed his mind when he heard the song, which according to Horner, he waited until Cameron was in an appropriate mood before he presented it to him. Cameron was worried he was going to be criticized for “going commercial at the end of the film”, though that actually turned out for the best on many levels. “My Heart Will Go On” ended up not only being Celine Dion’s signature song but also one of the most memorable elements from Titanic, and played a big role in the film’s success.

Next: Disney Owns 8 of the 10 Biggest Movies Of All Time