Fixing threads in server