In the new horror film At the Devil’s Door, a young woman played by Awkward star Ashley Rickards makes a deal with the Devil, and it has terrifying consequences for pretty much every character in the movie, including a pair of sisters played by Catalina Sandino Moreno (Maria Full of Grace) and Naya Rivera (Glee).

Writer-director Nicholas McCarthy reveals he got the inspiration for At the Devil’s Door during a bizarre cab ride at the 2012 Sundance Film Festival, where his previous terror tale, The Pact, was screening.

“When I was at Sundance, a cab picked me up to take me back to the condo that I was staying in,” explains the filmmaker. “The cab driver was this Chilean guy and he asked me what I was there for. I said, I’m here for this movie called The Pact.’ He said, ‘Is that about a pact with the Devil? I made pact with the Devil.’ So I said, to this complete stranger, ‘Tell me about that!’

“He proceeded to tell me this story about when he was a teenager in Chile. His friends knew this witch doctor that you could sell your soul to—and his friends dared him to do this. To show his friends that he was fearless, he went to this witch doctor and the witch doctor performed this whole weird ritual. At the end of the ritual, this witch doctor said to him, ‘Now tell me your name.’ At this point the guy is starting to get nervous. All his kind of being-an-atheist was being called into question. So he asked, ‘Why? Why do you want to know my name?’ And this witch doctor says, “So He knows you name when He calls for you.’ So the guy told him his name: Enrique. And he claims that he went home, and that night he was sitting in his kitchen and he heard from upstairs this voice call, ‘Enrique!’ And he went upstairs and there was no one there.”

“So this cab driver told me this story, and at this point I’m sitting in his cab, idling in front of my condo in Park City. And I asked him, ‘So, what happens?’ He said, ‘I fell in love with this girl who lives up in Park City and now I’m a cab driver here. Nothing happens.’ But I had never heard anything exactly like that and so it stuck. A few months later, when I went up to this cabin to write, I took that story and combined it with this other story about sisters—which came from Psycho. I wanted to see what would happen if these two things got put together with an aim towards unsettling and disturbing the audience. So that really was the origin of it.”

Rest assured, McCarthy came up with a much more chilling conclusion for At the Devil’s Door, which arrives in theaters Friday. Watch the trailer below.