update correctly old and new elements