In November 1873, a ship from Penang was attacked by pirates near Kuala Langat, Selangor. A court was assembled near Jugra and suspected pirates were sentenced to death. The sultan expressed concern and requested assistance from Sir Andrew Clarke. Frank Swettenham was appointed to serve as the sultan's advisor. Approximately a year later, a lawyer from Singapore named J. G. Davidson was appointed as British Resident in Selangor. Frank Swettenham was nominated for the Resident post but he was deemed too young.