I'm a bit worried about this (that's why I didn't do it originally). What if you are nested very deep, this is going to take a long time to traverse all directories all the way to the root. Also, this process will repeat for every nested subfolder. You should really beef up caching to handle subfolders not looking deeper then parent folder if you are going to do this (which it might already, I think).