add validation method and fix usage of directives