Korolev was sent to prison, where he wrote many appeals to the authorities, including Stalin himself. Following the fall of NKVD head Nikolai Yezhov, the new chief Lavrenti Beria chose to retry Korolev on reduced charges in 1939; but by that time Korolev was on his way from prison to a Gulag camp in the far east of Siberia, where he spent several months in a gold mine in the Kolyma area before word reached him of his retrial. Work camp conditions of inadequate food, shelter, and clothing killed thousands of prisoners each month. Korolev sustained injuries and lost most of his teeth from scurvy before being returned to Moscow in late 1939. When he reached Moscow, Korolev's sentence was reduced to eight years to be served in a "sharashka" penitentiary for intellectuals and the educated. These were labor camps where scientists and engineers worked on projects assigned by the Communist party leadership. The "Central Design Bureau 29" (CKB-29, ЦКБ-29) of the NKVD, served as Tupolev's engineering facility, and Korolev was brought here to work for his old mentor. During World War II, this "sharashka" designed both the Tupolev Tu-2 bomber and the Petlyakov Pe-2 dive bomber. The group was moved several times during the war, the first time to avoid capture by advancing German forces. Korolev was moved in 1942 to the "sharashka" of Kazan OKB-16 under Glushko. Korolev and Glushko designed rocket-assisted take off boosters for aircraft and the RD-1 kHz auxiliary rocket motor tested in an unsuccessful fast-climb Lavochkin La-7R. Korolev was isolated from his family until 27 June 1944 when healong with Tupolev, Glushko and otherswas finally discharged by special government decree, although the charges against him were not dropped until 1957.