fix for test mode detection