Update Insert, Delete duplicate insert function