synchronized should move to startServer.