A family tragedy has led Zack Snyder to step away from the upcoming Justice League film.

According to the Hollywood Reporter, Joss Whedon, who wrote and directed Marvel Studio’s The Avengers and its 2015 sequel, will step in to complete the DC Comics movie as Snyder tends to family matters. Snyder’s wife and co-producer Deborah Snyder will also take a break from the film.

The publication reports Snyder made the decision following the death of his daughter Autumn Snyder, who committed suicide in March at the age of 20. The director said he initially had no intention of leaving the project, but felt the demands of the gig were taking away from his family.

“In my mind, I thought it was a cathartic thing to go back to work, to just bury myself and see if that was way through it,” Synder told THR. “The demands of this job are pretty intense. It is all consuming. And in the last two months I’ve come to the realization… I’ve decided to take a step back from the movie to be with my family, be with my kids, who really need me. They are all having a hard time. I’m having a hard time.”

Whedon was initially brought on board to write additional scenes for Snyder; however, when it came time to actually film the parts, Snyder couldn’t bring himself to leave his family. So Warner Bros. officials decided to let Whedon take over.

“The directing is minimal and it has to adhere to the style and tone and the template that Zack set,” Warner Bros. Pictures president Toby Emmerich said. “We’re not introducing any new characters. It’s the same characters in some new scenes. He’s handing a baton to Joss but the course has really been set by Zack. I still believe that despite this tragedy, we’ll still end up with a great movie.”

Justice League—which will star Ben Affleck, Henry Cavill, Amy Adams, Gal Gadot, Jason Momoa, and Ezra Miller—is still set to hit U.S. theaters on Nov. 17.