finally fixed the threaded echo server