Fix stop method to stop the websocket server.