add support for OnShutdown lifecyle