added onShutdown event that fires after the connection has been closed (background processing)