raise errors if required attribute is missing