converting output object to array