In 1795, the Dutch temporarily withdrew from Malacca for the duration of the Napoleonic Wars in Europe. Malacca's authority was transferred to the British Resident. When war ended, the Dutch returned to administer Malacca in 1818. In 1818, the Dutch monopoly over the tin trade in Perak was renewed, with the signing of a new recognition treaty. The same year, when Perak refused to send a "bunga mas" tribute to the Siamese court, Rama II of Siam forced Kedah to attack Perak. The Sultanate of Kedah knew the intention behind the order was to weaken ties between fellow Malay states, but complied, unable to resist Siam's further territorial expansion into inland Hulu Perak. Siam's tributary Malay state, the Kingdom of Reman, then illegally operated tin mines in Klian Intan, angering the Sultan of Perak and provoking a dispute that escalated into civil war. Reman, aided by Siam, succeeded in controlling several inland districts. In 1821, Siam invaded and conquered the Sultanate of Kedah, angered by a breach of trust. The exiled Sultan of Kedah turned to the British to help him regain his throne, despite Britain's policy of non-engagement in expensive minor wars in the Malay Peninsula at the time, which the EIC upheld through the Governor-General of India. Siam's subsequent plan to extend its conquests to the southern territory of Perak failed after Perak defeated the Siamese forces with the aid of mixed Bugis and Malay reinforcements from the Sultanate of Selangor. As an expression of gratitude to Selangor for assisting it to defeat Siam, Perak authorised Raja Hasan of Selangor to collect taxes and revenue in its territory. This power, however, was soon misused, causing conflict between the two sultanates.