fix SQL connection