Fix multithreaded server