Adds check for directive to ensure data variable is definied