NEW YORK -- Facebook is apologizing to drag queens and the transgender community for deleting accounts that used drag names like Lil Miss Hot Mess rather than legal names such as Bob Smith.

The world's biggest online social network caught heat recently when it deleted several hundred accounts belonging to self-described drag queens, other performers and members of the lesbian, gay, bisexual and transgender community. Facebook has long required its users to go by their "real names" on the site for security purposes, to stand out from other social networks and so it can better target advertising to people. Now, the company says the spirit of its policy doesn't mean a person's legal name but "the authentic name they use in real life."

"For Sister Roma, that's Sister Roma. For Lil Miss Hot Mess, that's Lil Miss Hot Mess," Chris Cox, Facebook's vice-president of product wrote in a blog post Wednesday.

Though the real names policy isn't changing, the way Facebook enforces it might.

Last month, the company suggested that performers such as drag queens have other ways of maintaining their stage identities on the site, such as creating pages that are meant for businesses and public figures. But a fan page is not the same as a regular Facebook account and users were not happy with the suggestion.

While standing by the real names policy on Wednesday, Cox said "we see through this event that there's lots of room for improvement in the reporting and enforcement mechanisms, tools for understanding who's real and who's not, and the customer service for anyone who's affected."

Cox also gave some background on why so many accounts with drag names and other stage names suddenly started getting deleted.

"An individual on Facebook decided to report several hundred of these accounts as fake," he wrote. "These reports were among the several hundred thousand fake name reports we process every single week, 99 per cent of which are bad actors doing bad things: impersonation, bullying, trolling, domestic violence, scams, hate speech, and more -- so we didn't notice the pattern."