Initialize Main just after canvas is rendered