Thread is producing correct output.