create id before upsert