revised the server code
updated the server code