Need to close the connection before we shutdown