Fix a dependence bug for ContextHistory with JSON