add required flag to attributes