bug fix and add a new option in config file