fix NPE while saving configuration file.