fix new element addition and update