I am so sorry too for what you are going through and though I do not know the full circumstances think that gaining custody of your granddaughter is a good idea. She needs the stability. Sometimes when a mother is faced with the loss of a child it has them do something about their addiction. Operative word 'sometimes'. Stay posted and talk with others who understand and have the lived experience.