Fixed php warning

line 718 to check if object is either array or traversable (iterable)
before foreach statement