 He was an unsuccessful candidate for reelection in 1826 to the Twentieth Congress.He was appointed naval officer of Philadelphia by President Andrew Jackson and served from 1826 to 1829.He served as attorney general of Pennsylvania in 1829.