diff --git a/cmd/root.go b/cmd/root.go
index 0b3178dc80141b0584f8ffc91bdae4de668d5d73..60d5ec5e8f32cbeafceb8eda3d0c73d2b7d7ea18 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -274,7 +274,7 @@ var rootCmd = &cobra.Command{
 		// Set the cert paths explicitly to avoid data races
 		SetCertPaths(gwCertPath, registrationCertPath)
 
-		sessionInitialization()
+		userID := sessionInitialization()
 		// Set up the listeners for both of the types the client needs for
 		// the integration test
 		// Normal text messages
@@ -296,8 +296,6 @@ var rootCmd = &cobra.Command{
 				(time.Duration(float64(1000000000) * (float64(1.0) / dummyFrequency)))
 		}
 
-		userID := sessionInitialization()
-
 		// Only send a message if we have a message to send (except dummy messages)
 		recipientId := new(id.User).SetUints(&[4]uint64{0, 0, 0, destinationUserId})
 		if message != "" {