added check when deleting jobs