added attempts method to jobs.