change calls to is_array and is_object