reads and writes to config file