Set the connection status when it is closed