fix bug in Deamon.cpp, and prepared for old client