check required fields only on insert and upsert