client with while loop