lupita nyong'o and taylor swift
Credit: Jon Kopaloff/Getty; Gregg DeGuire/Getty

Lupita Nyong’o loves Taylor Swift‘s music just as much as the rest of us. Speaking to the audience at the Sundance Film Festival in Park City, Utah this week, Nyong’o revealed that Swift’s 2014 hit “Shake It Off” got her through a hard time in her life. “‘Shake It Off’ means a lot to me,” Nyong’o said, according to the New York Post. “I was going through a hard time professionally, and I was just in a funk.”

Nyong’o was at Sundance to promote her new movie, Little Monsters, which premiered at the film festival this week. In the movie, Nyong’o plays a school teacher who has to protect her young students from a zombie invasion. Her character, Miss Caroline, plays the ukulele and sings songs to keep the children calm—including “Shake It Off.” Nyong’o revealed that she wrote directly to Swift to ask for permission to use the song in the film.

Credit: Daniel Boczarski/Getty Images

“It meant a lot to me that this film had that [song],” the actress said. “And so when I heard that they were having a hard time [getting the rights], I wrote Taylor Swift myself and asked her and told her that story—and she said yes!” Speaking to USA Today, Nyong’o said “Shake It Off” was part of why she agreed to do the film. “That’s one of the reasons why my interest was piqued in this movie when I read the script,” Nyong’o told the outlet, “because I was like, ‘Someone else who loves ‘Shake It Off’ just as much as I do!’”

She also admitted that she was “very nervous” to sing on camera in Little Monsters. “I do enjoy singing but it’s not often that I do it in the movies,” she said. “It was a weird feeling. But I learned to play the ukulele as well, so it was all really uncharted territory.

Besides Little Monsters, this year Nyong’o will also star in Jordan Peele‘s follow-up to Get Out, a horror movie titled Us, out on March 15th. Little Monsters will be released later this year by Neon and Hulu.