use upsert on updating db