add registerShutdownHook