added ability to set the root directory