adds validation of required attributes

Redundant `self` detected.