Making a huge guess here, but are you sure you don't mean
Then, assuming ID is a scalar,
returns true, which I'm guessing is the result you are intending.
Like I said ... just a guess. (And you might need to adjust your other logic accordingly.)
Part of the reason I am guessing this is that
returns a vector of values (if A is a vector and ID is a scalar), which is not typically what you want in an if statement. But maybe it is in your case.