proper chat bewtween client and server and stops when client enters 'end'