need to finish a few functions in CilentThread.