Added getCollectFiles function