add shutdown hook for worker