using Array.isArray instead of isarray package