diff --git a/agent/tcs/client/client.go b/agent/tcs/client/client.go
index <HASH>..<HASH> 100644
--- a/agent/tcs/client/client.go
+++ b/agent/tcs/client/client.go
@@ -15,7 +15,7 @@ package tcsclient
 
 import (
 	"bytes"
-	"errors"
+	"fmt"
 	"net/http"
 	"time"
 
@@ -69,15 +69,17 @@ func New(url string, region string, credentialProvider credentials.AWSCredential
 func (cs *clientServer) Serve() error {
 	log.Debug("Starting websocket poll loop")
 	if cs.Conn == nil {
-		return errors.New("nil connection")
+		return fmt.Errorf("nil connection")
 	}
 
-	// Start the timer function to publish metrics to the backend.
-	if cs.statsEngine != nil {
-		cs.publishTicker = time.NewTicker(cs.publishMetricsInterval)
-		go cs.publishMetrics()
+	if cs.statsEngine == nil {
+		return fmt.Errorf("uninitialized stats engine")
 	}
 
+	// Start the timer function to publish metrics to the backend.
+	cs.publishTicker = time.NewTicker(cs.publishMetricsInterval)
+	go cs.publishMetrics()
+
 	return cs.ConsumeMessages()
 }
Don't consume messages in tcs if statsengine is empty