Made index for dirs optional