Fixing bugs in server