Array.isArray check is added to see whether isArray function is available