Changed check on flag id