correct state record name
Untangle and debug connection close.