adding optional root  directory