insert functionality updated