Update main.cpp

Fix for saving configuration