removed toArray logic