fixed Inherit bug in flag check