fixed a issue with entity check and modified directives