Added multithreading to client