fixed client inifinite loop