made the directive work properly