fix some bugs on server