Fix find root dir method