added clear jobsDir before writing jobs