Rewrote code-canvas to wait for content to load