updated flash mode detection