added functionality to use root directory