improve worker shutdown