Fix dead lock problem.