Implement auto-shutdown