erc tidy up, add insert date func