fix flag access