Unity freeze when assigned canvas

So i am following a tutorial online to make a 2D puzzle pipe game. Some things in his code where wrong so i adjusted it. But at the end of the serieus he makes it so it generated puzzles from itself. He made an object called manager to do it. This works if you run the game but when you code it so it opens a canvas that is inactive. And assign the canvas to the manager. Unity freezes when you hit the play button. I dont get any crash reports and centra. Does anyone know what the problem could be?

Does it freeze or fully crash?
Can you still exit play mode? (maybe its an error and you use pause on error?)