modified server code