Jennifer Lopez came under fire from critical fans last week when it came to light that Lukasz "Dr. Luke" Gottwald had co-produced her new track "Ain't Your Mama" with its writer Meghan Trainor. Given the sexual assault and abuse allegations brought against Gottwald by Kesha, people were upset over Lopez's apparent choice to work with him. But Trainor says J. Lo had no idea Luke had ever been involved, and could we all cut her a little slack, please?

"[It was] not fair on her, not at all," Trainor told Official Charts. "I texted her the song and she had no idea — she thought I did it alone by myself at my house, which a lot of people think because I do do that." Trainor reportedly first wrote the song years ago, and that was when Dr. Luke actually produced the track, according to a report from E!.

"I sent it to her and said, 'Do you like the song?' and she said, 'I love the song. My kid loves the song — he’s made me play it five times already, so I know it’s a hit. When can I cut it?' so I said, 'Immediately. Whenever you want!'"

Trainor continued, saying that while she's thrilled several songs she wrote wound up on Lopez's upcoming album, it still bums her out that J. Lo's been on the receiving end of so much criticism for "Ain't Your Mama."

"I felt terrible when Jennifer got all the hate for ['Ain't Your Mama'], and it's just all ridiculous. It's such a big song for her," she said. "After the last album, I've been listening to this new album and I'm like, it's night and day. The music is there, the melodies are there, and a lot of my songs are self-empowerment songs, and she loved that about my writing."

Lopez has yet to comment on the controversy. "Ain't Your Mama," released on April 8, currently sits at No. 44 on iTunes' 100 Top Songs.

See What Artists Looked Like When They Released Their Debut Albums