Updated stop server code