add directives and scopes