fixed errors in server code

fixed a few errors in server code