fix client & server bugs