Fixed canvas null error