toArray function added in collection module