Fix to thread access problem.