While it is prudent to look at what can reasonably be done to try to prevent these horrific acts from happening or to lessen their impact, misuse of freedom by some is the price of freedom. There is no "will never happen again" solution. None.
So, you might say that accepting this as a risk is part and parcel of living in a free nation?