upsert didn't seem to work so had to turn to conditions.