added mandatory callback toArray