diff --git a/tasks.py b/tasks.py
index 6001440ae2c6c9cb25440d7767509c4fc1be3a87..6b5973af1518c4c4a69fedd00b85655436ee4e5f 100644
--- a/tasks.py
+++ b/tasks.py
@@ -16,24 +16,27 @@ celery = Celery('flask_user_reg', broker=broker_url)
 socketio = SocketIO(message_queue=vars.message_queue)
 timeout = 60
 
-def callback(channel, method, properties, body):
-    msg = json.loads(body)
-    username = msg['username']
-
-    if msg['success']:
-        print(f'Account for {username} has been created.')
-    else:
-        print(f"There's some issue while creating account for {username}")
-        errmsg = msg.get('errmsg', [])
-        for err in errmsg:
-            print(err)
-
-    rc_util.rc_rmq.stop_consume()
-    rc_util.rc_rmq.delete_queue()
+def gen_f(room):
+    def callback(channel, method, properties, body):
+        msg = json.loads(body)
+        username = msg['username']
+
+        if msg['success']:
+            print(f'Account for {username} has been created.')
+            send_msg('account ready', room)
+        else:
+            print(f"There's some issue while creating account for {username}")
+            errmsg = msg.get('errmsg', [])
+            for err in errmsg:
+                print(err)
+            socketio.emit('account error', errmsg, room= room)
+
+        rc_util.rc_rmq.stop_consume()
+        rc_util.rc_rmq.delete_queue()
+    return callback
 
 def send_msg(event, room):
-   print("Post '{}' to room '{}'".format(event,room))
-   socketio.emit(event, room=room)
+    socketio.emit(event, room=room)
 
 def timeout_handler(signum, frame):
     print("Process timeout, there's might some issue with agents")
@@ -53,11 +56,8 @@ def celery_create_account(json, session):
     rc_util.add_account(username, email, fullname, reason)
     print('sent account info')
     
-    # Set initial timeout timer
-    signal.signal(signal.SIGALRM, timeout_handler)
-    signal.setitimer(signal.ITIMER_REAL, timeout)
-
 
     print('Waiting for completion...')
-    rc_util.consume(username, routing_key=f'complete.{username}', callback=callback)
-    send_msg('account ready', room) 
+    #print(callback(self.EXCHANGE, self.EXCHANGE,self.EXCHANGE,self.EXCHANGE))
+    rc_util.consume(username, routing_key=f'complete.{username}', callback=gen_f(room))    
+    #send_msg('account ready', room)