added recursive parameter to Colleciton->toArray()