edit mode updated and history implementation