changed collection to maincollection