Use defined instead of exists.
In reply to Re: Using exists to check element in array by ikegami in thread Using exists to check element in array by david