changed isArray condition