removing current config before writing new one (makes sure old files get
cleaned up)