fix for flattenarray
fix for flattenarray