fix toArray convertion