fixed some server bugs