Found a bug. When draw is fired too early it breaks because the canvas isnt defined yet