handling new clients in a separate thread