Update base\mg, add lastError