Fixed a bug Applying directives