remove trailing whitespace
handle case when current directory has mulitple valid path names