bug(dd-lib): identify custom directives currectly, fix logic