Added option to set root directory