adds validation of required attributes

Trailing whitespace detected.