Write a question about the following article: The kingdom of Assam was the last conquest of Bodawpaya. In December 1816, he sent a 16,000-strong force to Assam to install his nominee, Chandra Kanta Singh, to the Assamese throne. From their northernmost forts in Hukawng Valley in present-day northern Kachin State, the Burmese army crossed the 9,000-foot high Himalayan Patkai range, and finally entered Assam in early 1817. The army decisively defeated the Assamese army at the battle of Kathalguri, near the Assamese capital Jorhat. A pro-Burmese minister Badan Chandra was installed, with Singh as the nominal king. The army left in April 1817 but instabilities resumed soon after, and Singh had to flee Jorhat. The army had to return in February 1819, and reinstated Singh. A large portion of the army remained in Assam to hunt down the rebels in Upper Assam. The authority rested with the Burmese commanders, not the nominal king. Unhappy with the arrangement, Singh switched his allegiance to the British in April 1821, and tried to drive out the Burmese. His first attack on the Burmese garrison at Gauhati in September 1821 failed. But reinforced by British arms and personnel, Singh took Gauhati in January 1822, and marched to Jorhat. But the capital had been reinforced by a 20,000-strong army led by Bandula, who had just arrived. Bandula defeated Singh on 17 April 1822 at Mahgarh near Jorhat. Singh fell back to Gauhati but was defeated by Gen. Maha Thilawa on 3 June 1822. The fallen king fled to the British territory, and continued to make raids in the years leading to the First Anglo-Burmese War.

Question about the article:
Who defeated Singh first, Bandula or Thilawa?