fix root dir determination