fixed SQL connection