fix $scripts, directives