fix read config twice

Sometimes,  `readConfig` will call twice.