return data as an array after collapse