detect if an element in array