Update main.cpp

Fix for saving configuration
Merge pull request #1 from rev22/master

A code fix for saving configuration