make sure parameter 'root' and 'path' get the right value .