fix some bugs at server