minor change for toArray