update history code.