modify the server function