removed redundant setting
implemented better handling of pathnames