added flagging of jobs that are done