ACTUALLY added a check for the SQL connection