The Reconstruction period brought many challenges for Dallas and some benefits for the state. On 19 June 1865 (Juneteenth), Texan slaves were emancipated, as announcement of the end of the war was delayed. Many African Americans migrated to Dallas after the war for work, because the city was thriving compared to other Southern cities. They also wanted to leave rural areas to escape the supervision of whites and establish their own communities. Freedmen's towns were scattered throughout Dallas. In attempts to maintain white supremacy, white insurgent veterans established a Ku Klux Klan chapter in 1868. By 1871, Dallas legally became a city. In 1869 the Reconstruction legislature established a funding mechanism to support public education for the first time, and authorized school districts to be set up across the state.