Updated insert method