change to use Array.isArray