refine the method to get the config file

refine the method to get the config file