Added while loop in client