changed the way the directive works