This should be moved after this conditional ensuring we are in the Disconnected state. If the connection isn't in the Disconnected state we  will be overwriting an existing HeartbeatMonitor which will never get disposed.