added support for predetermined number of collections