It seems that algorithms have once again shown they’re still far from perfect. This latest instance comes from China’s WeChat messaging service, whose system translated the neutral Chinese phrase “black foreigner” into the N-word.

Ann James, a black American theatre producer and actor who resides in Shanghai, discovered the racial slur was being used when she texted her Chinese colleagues to say she was running late. The translated reply read: “The n***** is late.”

WeChat’s in-app translation system had changed the phrase “hei laowai,” which literally means “black foreigner” and isn’t a profanity, into the offensive word.

A WeChat spokesperson told Chinese outlet Sixth Tone that this was a result of its neural machine learning engine, which may have picked up the term from the large data sets it is fed and used it in the context of an offensive association.

When wishing someone happy birthday, for example, the app translated “hei laowai” to “black foreigner,” but when a sentence included negative words like “late,” “lazy,” or “thief,” the racist insult was used.

WeChat has now altered the algorithm so the phrase will no longer be translated as the n-word. A WeChat spokesperson added that the engine was constantly being refined to provide “more accurate, faithful, expressive, and elegant” results.

“If you’re a black person in China, you’ve come up against some craziness,” said James, who recently appeared in Chinese box office smash Wolf Warrior 2. “I know there’s a lot of curiosity and a lot of ignorance about black people [in China].”

This certainly isn’t the first awkward mistake made by algorithms, and it won’t be the last. A few weeks ago, Instagram’s algorithms used a post showing a rape threat in an ad that appeared on Facebook, and back in 2015, Google Photos labeled an image of two black people as “gorillas.”