More than a decade ago, Philadelphia entered a dark period where every few months, a police officer was killed in the line of duty.

It started with Officer Gary Skerski, who was shot while responding to an armed robbery on May 8, 2006. Officer Skerski’s death was followed by the murder of Officer Charles Cassidy, who was shot in the head during a robbery on Nov. 1, 2007; then Officer Stephen Liczbinski, who was shot during a bank robbery on May 3, 2008; then Officer Isabel Nazario, whose patrol car was hit by a stolen SUV on Sept. 5, 2008; then Sgt. Patrick McDonald, who was shot when he pulled over a vehicle on Sept. 23, 2008; then Sgt. Timothy Simpson, whose patrol car was hit by an intoxicated driver on Nov. 17, 2008; and then Officer John Pawlowski who was shot while responding to a dispute on Feb. 13, 2009.

In less than three years, Philadelphia lost seven police officers in the line of duty.

And then, on July 8, 2012, Officer Brian Lorenzo was hit by a drunk driver while on patrol and died of his injuries. A month later on Aug. 18, 2012, Officer Moses Walker was killed in an attempted robbery while walking to the bus after his shift at the 22nd District. Then, on March 5, 2015, Sgt. Robert Wilson III was killed when he interrupted a robbery in a video game store. He was there buying a gift for his son’s birthday.

I’ve written about many of these officers over the last 13 years, and while their names have faded from the public discourse, I haven’t forgotten them. Neither, I know, have their families and colleagues, who are constantly reminded of their absence and sacrifice.

I thought of these brave cops when I read about an investigation into alleged racist social media postings made by current Philadelphia police officers. A database, compiled by a group called the Plain View Project and led by lawyer Emily Baker-White, highlights posts from officers in eight police departments across the country. The list cited 330 active Philadelphia police officers — including an inspector, six captains, and nine lieutenants — who made posts or comments that researchers considered dehumanizing, supportive of violence, and that “could erode civilian trust and confidence in police.”

Unsurprisingly, the disclosure of the database and its contents triggered strong responses from city officials.

Mayor Jim Kenney called the posts “deeply disturbing.” District Attorney Larry Krasner observed that “When police officers choose to make statements relevant to their work and then choose to publicize them to the world, they are also choosing any consequences that those statements, law and justice require.” And Police Commissioner Richard Ross confirmed that some of the officers have been under investigation by Internal Affairs since the department was informed of the database in February.

Clearly, no one should defend racist cops. Attacks on a person’s race, religion, and ethnicity have no place on the police force, and one rotten apple is one too many.

But I have to wonder why we so rarely hear about the good things police officers do? Why do we so often see front-page stories about officers when they are accused of wrongdoing or have been tragically murdered while protecting our city? Why don’t we see more stories about the positive, community-changing, generous work that most police officers do every day to make our city better?

It’s important to realize that social media posts are not always indicative of a person’s overall character. They might just be a reaction to the very real anxieties and frustration that come from being an officer who deals with the uglier side of society every day. That’s not an excuse, but our social media presence is not always the best measure of who we are or how we do our job.

So yes, let’s clean up the mess on the force. But let’s also remember that the vast majority of Philly officers are silent heroes.