Added SHUTDOWN hook.