edit hsitory logic