Moved the saving of file before the gain adding, added a gain in the yml config file