fix server bugs