21 years ago, audiences were floored by David Fincher’s Se7en, the compelling psychological crime thriller which became an instant classic thanks, in part, to a particularly twisted ending. But that ending, box and all, almost didn’t happen. In a new interview, screenwriter Andrew Kevin Walker reveals some interesting trivia about Fincher’s classic, which never would have achieved that status had he received the correct draft of Walker’s script.

Speaking with THR, Walker says Jeremiah Chechik, the director of Christmas Vacation (yes, really) was originally set to helm Se7en. After reading the script, Chechik requested some drastic changes, specifically to that famous ending. In the film, Brad Pitt’s Detective Mills has apprehended serial killer John Doe (Kevin Spacey), who has orchestrated his most diabolical plot yet: Doe murders Mills’ wife (Gwyneth Paltrow) and has her head sent to the detective in a box, spurring Mills to become the seventh deadly sin — wrath — by executing Doe.

Chechik wasn’t a fan of that ending and had Walker revise the screenplay to remove the famous “What’s in the box?!” scene and change the setting of the final act to a “burnt out church.” As Walker began to lose hope in seeing his story adapted, his script continued to circulate around Hollywood until it landed in the hands of Fincher — who was mistakenly sent the original draft instead of the revised version. Says Walker:

[Fincher] expressed some interest, but in expressing his interest to them, had mentioned there was a head in the box. And they were like, ‘Oh, no, no, no. We sent you the wrong draft.’ And then they sent him the vastly rewritten, Jeremiah Chechik draft, which had a completely different ending and Fincher said, ‘No, I wouldn’t be interested in doing that.’

He met with Fincher shortly after and, anticipating that the director would be requesting several changes (like Chechik), Walker brought his notepad. He was surprised when Fincher told him to put it away. Walker describes Fincher as “one of the rare people who is respectful of every piece of material that comes across his purview,” and though it’s possible that Fincher would have signed on to direct the film anyway, Walker explains that Se7en never would have existed as it does were it not for that mixup:

As a writer, when you come on a project and you don’t see eye to eye with the director … you have to make a choice whether you are going to stick around and rewrite stuff or perhaps feel like you are ruining your own material. That said, had I told Jeremiah Chechik during the process of rewriting Se7en, ‘You know what, I don't really agree with getting rid of this stuff and changing the ending and setting it in a kind of burnt out church, and getting rid of the head in the box, etc. So I quit.’ If I had done that, I wouldn’t have been around for the happenstance, luck, fate of Fincher receiving the wrong script. He might have gotten my script, but it would have been at least one, maybe several writers down the line, and he probably would have proceeded with those other writers.

So there you have it: One of the greatest, most harrowing film endings of all time was the result of a happy accident.

More From ScreenCrush