added functions to change working directory to thBase.directory