fix server bugs

fix server bugs