Synchronize yaml save to close #286, crash on end