fix 3 level nested state transition problem.