removed unnecessary code in the directive.