fix for mode detection / optimization