The Federal Republic of Central America was a short lived democracy founded in 1821. The Republic consisted of the present-day states of Guatemala, El Salvador, Honduras, Nicaragua, and Costa Rica. It was reabsorbed by Mexico in 1822 for year until gaining its independence again.
In practice, the federation faced insurmountable problems, and the union slid into civil war between 1838 and 1840. In a relatively quick amount of time, the republic balkanized into the nations that would become Central America.
How do I stop this? What is the smallest change that can be made to the Federal Republic of Central America (1821-1840) that would allow it to remain an independent nation?