The actress spoke with the audience at the Sundance Film Festival about how much she loved the 2014 Taylor Swift hit "Shake It Off"

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, 35, 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.”

“I was working abroad, and my best friend came to cheer me up,” the Black Panther actress continued. “He played ‘Shake It Off’ on his phone, and we just had a dance party in my bedroom.”

Credit: JEAN-BAPTISTE LACROIX/AFP/Getty; Leon Bennett/FilmMagic

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”!

2019 Sundance Film Festival - "Little Monsters" Premiere
Lupita Nyong’o at the premiere of Little Monsters
| Credit: George Pimentel/Getty

Nyong’o revealed that she wrote directly to Swift, 29, to ask for permission to use “Shake It Off” in the film.

“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!'”

Nyong’o 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 15. Little Monsters will be released later this year by Neon and Hulu.