setting datasource of collectionView and reloading collectionView where necessary