Fixed. added nullcheck before using mazecanvas and moved call to load or reset until after mazecanvas creation.