fixed bugs in server/client