fix read config twice

Fix `readConfig` call twice problem.