fix bug for config rewrite