actually cd into $dir