Fixed this so that it actually does an upsert as intended.