bug fix for server.cpp