Fixed mainCanvas problem caused by undeclared var at runtime