President Obama signed legislation into law on Friday that ensures overtime compensation for Secret Service agents responsible for protecting presidential candidates this year.

The measure passed unanimously in both the House and Senate and was among the bills Obama signed before he left for his annual holiday trip to Hawaii.

At least 1,000 Secret Service agents maxed out their pay earlier this year, meaning they effectively worked overtime hours for free during the final months of the presidential campaign. Enactment of the measure means that the agents will be paid for hours they worked during the campaign.

ADVERTISEMENT

Agents’ annual salaries are limited to $160,300, including overtime. Some agents hit the compensation limits before the GOP and Democratic conventions in July, ahead of the general election phase of the campaign.

In addition to presidential candidates, Secret Service agents handled security for President Obama, Vice President Biden, four former presidents and their families.

Lawmakers called for finding a way to avoid forcing agents into the same situation during the next presidential campaign.

“There’s got to be a way that we can estimate roughly what the overtime needs will be every four years and incorporate something that at least eliminates the need to have Secret Service agents working for free in a very dangerous job,” Rep. Stephen Lynch (D-Mass.) said before House passage in late November.