Added function to stop a worker