smart directives bug fix