diff --git a/prod_rmq_agents/get-next-uid-gid.py b/prod_rmq_agents/get-next-uid-gid.py
index fc3d816f223fe5968e5beefa1e0dbeb5efcb529a..5fbd7e4de50c9edbb4889b654ac4360e06dd9765 100644
--- a/prod_rmq_agents/get-next-uid-gid.py
+++ b/prod_rmq_agents/get-next-uid-gid.py
@@ -9,6 +9,8 @@ import rc_util
 from os import popen
 from rc_rmq import RCRMQ
 import rabbit_config as rcfg
+from subprocess import run
+import shlex
 
 task = "create_account"
 
@@ -21,6 +23,8 @@ args = rc_util.get_args()
 logger = rc_util.get_logger()
 
 # Account creation
+
+
 def create_account(msg):
 
     logger.info(f"Account creation request received: {msg}")
@@ -36,7 +40,7 @@ def create_account(msg):
     cmd += 'commit;"'
 
     if not args.dry_run:
-        popen(cmd)
+        run(shlex.split(cmd))
         time.sleep(rcfg.Delay)
     logger.info(f"Bright command to create user:{cmd}")