check when set default-directory.