fixed the insert bug