Almost usable client and server, there is an logical issue