stopping the loop in client