Switch to using Array.isArray