Make backups when updating the config file

close #265 as well