fixed a bug in stopServer