fix to server code