Client thread now working correctly with standard input and output