is_array condition check interchanged