Adds auto-reconnect flag to prevent crashing upon a lost connection.