Facebook CEO Mark Zuckerberg speaks on a panel discussion with U.S. President Barack Obama (not pictured) during the 2016 Global Entrepreneurship Summit at Stanford University on June 24, 2016 in Stanford, California

Facebook CEO Mark Zuckerberg speaks on a panel discussion with U.S. President Barack Obama (not pictured) during the 2016 Global Entrepreneurship Summit at Stanford University on June 24, 2016 in Stanford, California

*Facebook announced Friday that it is taking steps to keep advertisers from excluding users based on race when they are looking for new tenants or job applicants.

The company said it will tweak its “ethnic affinity” marketing features to prevent discriminatory advertising in the areas of housing, employment and banking, according to Variety.

The move comes in the wake of a ProPublica investigation revealing that these affinity marketing tools could be used to exclude African-Americans, Latinos and Asian-Americans from housing ads — a practice that has been illegal since the passage of the Fair Housing Rights Act in 1968.

Although Facebook doesn’t ask users to check a race box when they sign up for the service, the social network uses other indicators — such as language preferences, as well as the pages and posts users have liked and interacted with — to lump account holders into so-called ethnic affinity groups.

The company has defended this practice as common ad targeting, but on Friday said that it was going to tweak its advertising products to prevent discrimination, reports Variety. This will include building tools capable of detecting potentially discriminating ads, as well as educating advertisers to make sure that they don’t run afoul of both anti-discrimination laws as well as Facebook’s own policies.

The move comes as Facebook is under fire for allowing fake news, including racially charged stories from alt-right groups, on its site. Facebook CEO Mark Zuckerberg responded to critics this week by calling the idea that this helped Donald Trump’s campaign “pretty crazy.”