Glee creator Ryan Murphy has revealed that Cory Monteith's character was going to become a teacher on Glee.

Monteith, who played Finn Hudson in the popular show, died from "mixed-drug toxicity, involving heroin and alcohol" in July, aged 31.

According to Entertainment Weekly, Ryan was planning to turn Cory's character into a Glee Club mentor to replace Will Schuester who was played by Matthew Morrison.

Ryan has now made public the touching eulogy which he read at the private memorial service held for Cory at Paramount Studios in Los Angeles, California.

He told his fellow mourners: ''For me, Cory was both the beginning and the ending of Glee . . . literally . . . The ending of Glee is something I have never shared with anyone, but I always knew it. I've always relied on it as a source of comfort, a North Star. At the end of season six, Lea [Michele]'s Rachel [Berry] was going to have become a big Broadway star, the role she was born to play.

''Finn was going to have become a teacher, settled down happily in Ohio, at peace with his choice and no longer feeling like a Lima loser. The very last line of dialogue was to be this: Rachel comes back to Ohio, fulfilled and yet not, and walks into Finn's Glee Club. 'What are you doing here?' he would ask. 'I'm home,' she would reply. Fade out. The end.''

He added: ''From the beginning Cory and I had a father-son relationship, which at that time, I have to admit, I did not want. I didn't know how to do that. But Cory - from a broken home, a lost boy - needed a male figure to provide guidance, support, a direction. In retrospect, Cory was kind of my training wheels for becoming the father I am today with my own child .

''And so he is frozen in a moment . . . Cory will continue to change lives for the better. It is a rare gift to touch the lives of one person, let alone millions.''