Connect code now with multi threading.