updated-insert functionality