wrong condition to check if element is in array