 He quelled the Walnut Street Prison riot in 1798 and also took part in suppressing others.He was elected mayor of Philadelphia sixteen times between 1798 and 1824.After serving two one-year terms, 1798–1800, he declined nomination in 1800.