fixed client stopping condition