fixed clientthread functions