fix history refresh bug