seeking a revival of his political fortunes, in 1873 banks ran successfully for the massachusetts senate, supported by a coalition of liberal republicans, democrats, and labor reform groups. the latter groups he wooed in particular, adopting support for shorter workdays. in that term, he help draft and secure passage of a bill restricting hours of women and children to ten hours per day. in 1874, banks was elected to congress again, supported by a similar coalition in defeating gooch. he served two terms (1875–1879), losing in the 1878 nominating process after formally rejoining the republican fold. he was accused in that campaign of changing his positions too often to be considered reliable. after his defeat, president rutherford b. hayes appointed banks as a united states marshal for massachusetts as a patronage reward for his service. he held the post from 1879 until 1888, but exercised poor oversight over his subordinates. he consequently became embroiled in legal action over the recovery of unpaid fees.