Fixed invalid win saving of SQL