adds validation of required attributes