fixed incorrect isArray check