debug mode detection