Fix a bug on directive