To prepare for an influx of visitors for an annual temple fair, Chinese officials decided to get their beggars out the way by shutting them up in an iron cage.

The Xishan Wanshou Palace Temple Fair, which takes place on the seventh month of the Chinese lunar calendar, fell out on Sept. 15 this year and brought in 200,000 tourists, BBC reports. Officials told China News that they feared stampedes and beggars bothering visitors, so they decided to contain about 100 beggars from the town of Xishan, in China’s southern Jiangxi province in a 165-foot-long iron cage.

“We had to consider both sides: the pilgrims and the beggars,” the head of the civil affairs office of the Xinjian prefecture government told NBC. “There are some fake beggars who just want to trick money from pilgrims. We did see the pilgrims were harassed by such beggars in the past. On the other hand, the temple fair is so crowded that beggars might be hit by cars or trampled by the crowd.”

The beggars voluntarily entered the cage, according to the news outlet.

But when photos of the confined beggars emerged on Sina Weibo, China’s popular version of Twitter, critics became outraged. The images were forwarded to more than 30,000 users and generated 4,000 comments by Sept. 18, according to China News.