fixed indexing of root directory