mode detection doesn't work