added expand-function to setcwd