President Donald Trump continued to point to mental-health solutions to America’s gun-violence problem this week, this time saying that he would like to reopen mental asylums that have been closed over the past few decades.

“Part of the problem is we used to have mental institutions ... where you take a sicko like this guy,” he said in a discussion with state and local officials about last week’s mass shooting at a high school in Florida. “We’re going to be talking seriously about opening mental-health institutions again.”

Though “sicko” is, of course, not a psychiatric diagnosis, some experts say Trump is not wrong to suggest that America’s mental-health-care system should be strengthened, including, perhaps, by reopening mental asylums.

The devil, though, would be in the details. Funding and regulating these places extremely well would help them avoid the fate of their gruesome predecessors from past centuries. But, experts say, we can’t count on asylums or any other kind of mental-health care to stop mass shootings. It would be only to help the mentally ill people themselves.

The number of patients living in U.S. psychiatric hospitals peaked in 1955 at 560,000. But in the decades following, mental-health care went through what’s known as “deinstitutionalization,” or the shuttering of mental hospitals. Far from being therapeutic, many of these hospitals were warehouses in which, say, schizophrenics would live alongside epileptics. Patients were often abused and rarely rehabilitated. When drugs that could control the delusions and psychoses of major mental illnesses came along, they were seen as a cheaper and more humane alternative to long-term, inpatient psychiatric care.

In 1963, President John F. Kennedy signed the Community Mental Health Act, which intended to create a network of community mental-health centers at which patients could get care while living on their own. But not enough of these centers were ultimately built to accommodate all of America’s mentally ill individuals. Then, President Reagan cut federal mental-health funding, and funding was further gutted during the Great Recession. There’s now a major nationwide shortage of psychiatric beds.

Currently, most people with mental illnesses get care on an outpatient basis (i.e., from a doctor they visit in an office) while living on their own. But the small percentage of mentally ill people who need weeks or months of care have very few options. The average psychiatric hospital stay usually lasts just a few days, or until the person is stabilized. There are bucolic, college-campus-like recovery facilities for severely mentally ill people, but they cost tens of thousands of dollars a month. Treating borderline personality disorder, for example, can take months of therapy. A program at the Gunderson Residence in Cambridge, Massachusetts, does so expertly—at a cost of at least $84,000.

Instead, many severely mentally ill people, especially if they’re poor, wind up on the streets or incarcerated. Today, the largest mental-health facility in any given state is often a jail, and half of all prisoners have a mental-health issue. Up to a quarter of the homeless are also mentally ill.

That’s why people like Dominic Sisti, a professor of psychiatry and behavioral-health care at the University of Pennsylvania, advocate “[bringing] back the asylum,” as he put it in a recent JAMA editorial.

Mental institutions don’t necessarily have to be bleak places where “sickos” are spirited away. In fact, they shouldn’t be. Instead, he argues, we could fully fund comfortable, therapeutic centers that care for mentally ill people who simply can’t live on their own, until they get better. The abuses of the past could be prevented with strict ethical regulations, he points out, like the kind medical researchers operate under today. The nurses and staff could be paid well; the patients could have their own rooms. It would be expensive, but worth it.

Think of it, Sisti told me, as the extreme end of a continuum of mental-health care, just like we have for cancer or other major illnesses. At one end, a person with a cancerous mole might be in and out of their dermatologist’s office in a few hours. At the other, a person getting brain surgery might be in the hospital for days. Similarly, these new mental asylums would be for only the most complex or hard-to-treat cases of mental illness.

What they wouldn’t do, Sisti says, is prevent violence. There are already places—jails and forensic hospitals—where people who commit crimes are sent. Meanwhile, only a small percentage of mentally ill patients are violent, and according to Sisti and others, it’s hard to tell which ones will turn out to be.

The problem with Trump’s suggestion is that it reinforces the connection between mental illness and violence. It’s unclear whether the shooter who opened fire on a concert in Las Vegas last October, for example, had a mental-health diagnosis. But, “he basically had an armory in a hotel room,” Sisti says.

Sisti notes that other countries deinstitutionalized just as the United States did. They, too, have a small number of psychiatric beds. But they don’t have mass shootings like the United States does. “The variable that keeps coming back, time and again,” he says, “is easy access to firearms.”