now working on client and server