The army under President Zia weakened due to the army officers were needed in running the affairs of civic government and the controversial military courts that held trials of the communists, dissidents, and the oppositions of Zia's administration. In 1984–85, Pakistan lost the control of her northern glaciers due to the successful expedition and penetration by the Indian Army, and army had to engage in years long difficult battles with Indian Army to regain their areas from the Indian Army. Concerns over the military officers and army personnel needed to counter the further advances by the Indian Army in Northern fronts in 1984, the martial law was lifted following the referendum that approved Zia's presidency and provided a way of holding the general elections in 1985. The military control the under army administration had successfully stabilized the law and order in Balochistan despite the massive illegal immigration from Afghanistan, and issued the general amnesties to separatists and rebels. To address the Afghan containment and security, the army established the XII Corps in 1985 that is permanently headquartered in Quetta, that is designed to provide defence against the infiltration by the Afghan National Army from Afghanistan.