add check for worker exit