change insert logic