change shutdown hook to new api