fix history update bugs