add history to doc and transformation for insert