doing upserts instead of inserts