updated server code