fix device flag