Fix duplicate directives issue