improved root folder handling