Fixed the insert method