Add auto shutdown function for testing