But before this time, King Chulalongkorn fully realized that it was necessary to modernize the administration of the country in order to protect the nation from foreign encroachment. A number of ministries were therefore established, beginning in 1892. To this end, the administrative system of foreign countries was used as a model. Thai students were sent to receive their education overseas and foreigners were also employed to provide assistance in technical matters