threading fix for server