update the insert method