Modify when config init set self.directory method

When I found that when initialized, the original method is actually some problems, it is logical cumbersome