added possibility of selecting root directory