The death of a psychiatric patient has led to major changes in mental health care in north Wales, an inquest has heard.
Lorna Graves-Lynch, 37, died at her flat in supported accommodation in Holywell, Flintshire, in November 2015.
A post-mortem examination found she has injected herself with more than six times the fatal dose of heroin - a drug she was addicted to.
Assistant coroner Nicola Jones recorded a conclusion of suicide.
The inquest in Ruthin heard Ms Graves-Lynch became addicted to painkilling drugs - and subsequently heroin - after giving birth.
She self-harmed several times, was admitted to hospital and did not want to be discharged.
On her latest discharge in October 2015, plans were drawn up for her to be treated in the community.
But she ended up sleeping rough when no local authority accommodation could be found and there was no room at the night shelter where she had been sent by taxi from hospital.
Her brother, Tony Graves, said she should not have been discharged because she had threatened to kill herself.
Ms Graves-Lynch's care co-ordinator, Janet Jacobs, told the hearing Ms Graves-Lynch was pleased when the Holywell accommodation was found and she spoke to her on a daily basis.
On 11 November, Ms Graves-Lynch told her support worker she had suicidal thoughts. She was found dead four days later.
Consultant psychiatrist Dr Alberto Salmairaghi, medical director for mental health with Betsi Cadwaladr University Health Board, said an action plan had been approved following a serious incident review.
One of the main proposals is a closer partnership between the health services, local authorities, police and ambulance to improve community care.
Asked if he thought there might have been a different outcome if Ms Graves-Lynch's case had been handled differently, he said he believed the mental health team's approach had been the right one.
After the hearing, Mr Graves said the family was pleased with the conclusion.