special handling for chdir and root directory