NEW YORK (AP) — Small businesses have extended their erratic hiring streak, adding 52,000 jobs in July.

That was up from 31,000 new jobs in June, according to payroll company ADP. It counted the number of new positions at its small business customers, those with up to 49 staffers.

Through the first seven months of the year, ADP says small companies added an average 48,000 jobs a month, with monthly totals ranging from 64,000 to 28,000.

Small business hiring has weakened in the past year. During the first seven months of 2017, companies had added an average 71,000 jobs per month.

Surveys, though, have shown that owners are still optimistic.