Update history logic