added insert functionality while searching