fix server bugs.