U.S. President Donald Trump was roundly criticized when, after expressing his outrage at and condemnation of the slaughter of 11 Jews at a Pittsburgh synagogue during Shabbat services, he also suggested that more security might have prevented the killer from carrying out his murderous intentions.

The pushback to Trump’s comment that, “If there was an armed guard inside the temple, they would have been able to stop him,” was intense. It was insensitive, as well as inappropriate for Trump to say anything in that moment that sounded like he was second-guessing the synagogue and its members after they were brutally attacked.

But while the timing was awful, despite some of the brickbats thrown at Trump by late-night comedians, the issue of security is no joke.

Stephen Colbert’s mocked Trump, saying, “Yes, it’s so simple. In fact, why didn’t the Jewish people have an armed guard for the last 5,000 years?”

That line got the expected laughs from an audience that always applauds attacks on the president, but you don’t have to have to be a historian to understand that a lot of lives would have been saved over the centuries had vulnerable communities been able to defend themselves from anti-Semites intent on shedding Jewish blood.

But while this issue, like just about everything else these days, seems to be all about Trump, it actually revolves around a dilemma that Jewish groups have been struggling with for decades. In an era in which violent extremism—both from the left and the right—is a reality that can’t be denied, how can communal institutions balance their desire to be open to the public with the need to deter terrorists? And if security is, as most now agree it must be, a priority, then how much is enough?

Anyone who has traveled to Europe knows that most synagogues or other recognizably Jewish buildings have taken on the aspect of armed fortresses. The rampant anti-Semitism that has spread across the continent has created a hostile environment for Jews to the extent that visitors to Western Europe are generally advised not to wear a kipah, Star of David or any other symbol that in effect puts a bull’s-eye on the back of those walking the streets in countries where being a Jew can be a hazardous endeavor.

Nor is it unusual to see security at American synagogues. While some Jewish institutions will have either local police or hired guards at larger events, in some places guards or their equivalent seeking to screen potential threats confront people entering buildings or even parking lots on a routine basis.

That those examples have been more the exception to the rule up until now is a tribute to the fact that most Jews do not feel unsafe in the United States. Nor, despite the best efforts of the Anti-Defamation League to flog misleading statistics about a supposed huge increase in anti-Semitic incidents in 2017 that is distorted by counting hoaxes that were not motivated by Jew hatred, is the United States a place where such bias generally thrives. Whatever you might think about Trump and even after Pittsburgh, this is still the safest and most free place for Jews to live in the history of the Diaspora.

Still, that doesn’t mean that we can or should ignore threat from anti-Semites, whether they are adherents of radical Islam or radical right-wing extremists.

Pittsburgh wasn’t the first attack on a Jewish building. There have been armed attacks on JCCs, federation buildings and synagogues before, though the tragic death toll in Pittsburgh far exceeds previous crimes committed against Jews in the United States.

But there are three main obstacles to addressing security problems.

The first is that many people are just uncomfortable with visible and permanent security precautions because it undermines the notion that community institutions such as synagogues are open spaces where all people should feel welcome.

There is also the fact that many in the overwhelmingly liberal Jewish community aren’t that comfortable with guns in general, and especially in a synagogue setting. So armed guards of the sort who could actually prevent a possible act of mass gun violence from succeeding are often considered out of the question.

Then there’s the question of cost. Most institutions are often working on threadbare budgets, leaving them hard-pressed to provide the services and programs congregants and community members need without having to protect their buildings. That’s why Jewish groups have been lining up along with the rest of the nonprofit world for funding from state and federal sources to get the money needed to augment their security.

But even when they do obtain funding, it’s virtually impossible to ensure that public buildings that house synagogues, community centers, schools, Hillel buildings on campuses or other Jewish agencies are invulnerable to a determined attacker, whether in the form of gunmen or potential bomb threats. They are just too large and porous, and there is too much public traffic to seal them off from harm. The best we can do is to deter terrorists by making Jewish targets a little harder, rather than sitting ducks waiting for the next mad killer to strike.

So while Trump’s comment was ill-timed, community leaders understand that even in a country as safe for Jews as the United States, thinking about how to prevent another such atrocity in our own communities is an imperative. Many of us would prefer to blame it all on Trump’s coarsening of the national dialogue or to place our hopes on gun-control proposals that would do little or nothing to prevent shootings by lunatics and ideologues. But it is high time to stop wishing away a threat rooted in ancient hates that have nothing to do with contemporary politics and to put in place measures that increase the chances that the next would-be anti-Semitic mass murderer won’t succeed in shedding any more Jewish blood.

Jonathan S. Tobin is editor in chief of JNS — Jewish News Syndicate. Follow him on Twitter at: @jonathans_tobin.