modified ClientThread