fix termination of workers