Added missing initialization check to main directive