change insert function