Fix the bug of saving config