fixed some bugs on server