correcting server code