fixed error in directive.js