Fixed bug in server code