replaced util.isArray with Array.isArray