fix termination of jobs