use an explicit test for flag checking