Auto mode detection