What did China agree to avoid the undermining of the Republic