Added save configuration function