Add SetFlagState extension