adding indices for each subdir